package jee.boot.entity.activiti;

import jee.boot.common.annotation.Column;
import jee.boot.common.annotation.Table;

/**
 * 业务流程定义数据表。此表和 ACT_RE_DEPLOYMENT 是多对一的关系，即，一个部署的bar包里可能包含多个流程定义文件，
 * 每个流程定义文件都会有一条记录在 ACT_REPROCDEF 表内，每个流程定义的数据，都会对于 ACT_GE_BYTEARRAY
 * 表内的一个资源文件和 PNG 图片文件。和 ACT_GE_BYTEARRAY 的关联是通过程序用ACT_GE_BYTEARRAY.NAME 与
 * ACT_RE_PROCDEF.NAME 完成的，在数据库表结构中没有体现。
 */
@Table(name = "act_re_procdef")
public class ActProcDef extends ActDataEntity<ActProcDef> {
    private static final long serialVersionUID = 1L;
    /**
     * 乐观锁
     */
    @Column(name = "REV_")
    protected String rev;
    /**
     * 流程名称（该编号就是流程文件process元素的name属性值）
     */
    @Column(name = "NAME_")
    private String name;
    /**
     * 流程编号（该编号就是流程文件process元素的id属性值）
     */
    @Column(name = "KEY_")
    private String key;
    /**
     * 流程命名空间（该编号就是流程文件targetNamespace的属性值）
     */
    @Column(name = "CATEGORY_")
    private String category;
    /**
     * 流程版本号（由程序控制，新增即为1，修改后依次加1来完成的）
     */
    @Column(name = "VERSION_")
    private int version;
    /**
     * 部署的ID
     */
    @Column(name = "DEPLOYMENT_ID_", data = {"deployment.id", "deployment.name", "deployment.category","deployment.deployTime"})
    private ActDeployment deployment;
    /**
     * 资源文件名称,流程bpmn文件名称
     */
    @Column(name = "RESOURCE_NAME_")
    private String resourceName;
    /**
     * 图片资源文件名称,png流程图片名称
     */
    @Column(name = "DGRM_RESOURCE_NAME_")
    private String dgrmResourceName;
    /**
     * 描述信息
     */
    @Column(name = "DESCRIPTION_")
    private String description;
    /**
     * 是否从key启动,
     * start节点是否存在formKey
     * 0否  1是
     */
    @Column(name = "HAS_START_FORM_KEY_")
    private int hasStartFormKey;
    /**
     * 是否挂起,1激活 2挂起
     */
    @Column(name = "SUSPENSION_STATE_")
    private int suspensionState;

    public ActProcDef() {
    }

    public ActProcDef(String id) {
        super(id);
    }

    public String getRev() {
        return rev;
    }

    public void setRev(String rev) {
        this.rev = rev;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public ActDeployment getDeployment() {
        return deployment;
    }

    public void setDeployment(ActDeployment deployment) {
        this.deployment = deployment;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getDgrmResourceName() {
        return dgrmResourceName;
    }

    public void setDgrmResourceName(String dgrmResourceName) {
        this.dgrmResourceName = dgrmResourceName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getHasStartFormKey() {
        return hasStartFormKey;
    }

    public void setHasStartFormKey(int hasStartFormKey) {
        this.hasStartFormKey = hasStartFormKey;
    }

    public int getSuspensionState() {
        return suspensionState;
    }

    public void setSuspensionState(int suspensionState) {
        this.suspensionState = suspensionState;
    }

    public static void main(String[] args) {
        System.out.println(new ActProcDef().getGetSql());
    }
}
